import _axios from '@/assets/js/http'
// 查询
export const doSearch = param => {
    let options = {
        url: api.supplier + '/supplierQualityRecord/list',
        method: 'POST',
        data: JSON.stringify(param),
        headers: {
            "Content-Type": 'application/json', 'Accept': 'application/json'
        }
    }
    return _axios(options)
}
// 查看
export const getDetails = barcode => {
    let options = {
        url: `${api.supplier}/supplierQualityRecord/getByCode?barcode=${barcode}`,
        // url: `api/supplierQualityRecord/getByCode?barcode=${barcode}`,
        method: 'GET',
        headers: {
            "Content-Type": 'application/json', 'Accept': 'application/json'
        }
    }
    return _axios(options)
}
// 通过id获取关联的订单
export const getGoodsDetail = id => {
    let options = {
        url: `${api.supplier}/supplierQualityRecord/${id}`,
        method: 'GET',
        headers: {
            "Content-Type": 'application/json', 'Accept': 'application/json'
        }
    }
    return _axios(options) 
}
// 获取质检状态选项
export const getQualityConditons = () => {
    let options = {
        url: `${api.base}/systemDictionary/getByType/qualityStatus`,
        method: 'POST',
        headers: {
            "Content-Type": 'application/json', 'Accept': 'application/json'
        }
    }
    return _axios(options)
}
// 各个状态对应的商品的数量
export const getGoodsCount = () => {
    let options = {
        // url: `${api.supplier}/supplierQualityRecord/getCount`,
        url: 'api/supplierQualityRecord/getCount',
        method: 'POST',
        data: JSON.stringify({}),
        headers: {
            "Content-Type": 'application/json', 'Accept': 'application/json'
        }
    }
    return _axios(options)
}